package tr.edu.yildiz.ce.dap.appagent.manager;

import tr.edu.yildiz.ce.dap.appagent.command.deployment.base.CommandConstants;
import tr.edu.yildiz.ce.dap.appagent.command.prompt.BasicPromptCommand;
import tr.edu.yildiz.ce.dap.appagent.command.prompt.DetailPromptCommand;
import tr.edu.yildiz.ce.dap.appagent.command.prompt.ListPromptCommand;
import tr.edu.yildiz.ce.dap.appagent.command.prompt.LocalInstallCommand;
import tr.edu.yildiz.ce.dap.appagent.command.prompt.LocalUninstallCommand;
import tr.edu.yildiz.ce.dap.appagent.command.prompt.RetrievePromptCommand;
import tr.edu.yildiz.ce.dap.appagent.exception.BasicAgentException;
import tr.edu.yildiz.ce.dap.appagent.process.base.AbstractProcess;

public class PromptManager {
	
	public static void callPromptCommand(AbstractProcess process ,String commandStr) throws BasicAgentException{
		BasicPromptCommand promptCommand = null; 
		if (commandStr.startsWith(CommandConstants.LIST)){
			promptCommand = new ListPromptCommand(process); 
		}else if (commandStr.startsWith(CommandConstants.RETRIEVE)){
			promptCommand = new RetrievePromptCommand(process); 
		} else if (commandStr.startsWith(CommandConstants.DETAIL)){
			promptCommand = new DetailPromptCommand(process); 
		} else if (commandStr.startsWith(CommandConstants.INSTALL)){
			promptCommand = new LocalInstallCommand(process);
		}else if (commandStr.startsWith(CommandConstants.UNINSTALL)){
			promptCommand = new LocalUninstallCommand(process);
		}
		promptCommand.call(process,commandStr);
	}
	

}
